package xcmg.device.infra.enums;

/**
 * sap同步状态
 *
 * @author wangyong1015
 */

public enum SapSynStatusEnum {

    SYNC_NO(0, "未同步"),
    SYNC_SUCCESS(1, "同步成功"),
    SYNC_FAILURE(2, "同步失败");

    private int status;

    private String desc;

    SapSynStatusEnum(int status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByStatus(int status) {
        for (SapSynStatusEnum statusEnum : SapSynStatusEnum.values()) {
            if (statusEnum.getStatus() == status) {
                return statusEnum.getDesc();
            }
        }
        return SYNC_NO.getDesc();
    }
}
